package com.cyy.admin.repository;

import com.cyy.admin.entity.SysSystemlogEntity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

/**
 * 
 * 
 * @author chenyuyi
 * @date 2021-12-12 13:11:18
 *
 * 接口用法大全。
 * https://mapperhelper.github.io/all/
 */
@Repository
public interface SysSystemlogRepository extends JpaRepository<SysSystemlogEntity,String>, JpaSpecificationExecutor<SysSystemlogEntity>{

    @Query("select s from SysSystemlogEntity s where s.id in (select max(ss.id) from SysSystemlogEntity ss where ss.account = ?1)")
    SysSystemlogEntity findFirstByOrderByLogintimeDesc(String usrName);
}
